<%@page import="Model.Bean.Phone"%>
<%@page import="Model.Util.PhoneModel"%>
<%@page import="java.util.ArrayList"%>
<%@ page import="com.sun.corba.se.spi.activation.Repository"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%//@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%//@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
	<%
		if(request.getParameter("PhoneID")==null) {
			response.sendRedirect("frmAminIndex.jsp");
		}
	
		Phone phone = new PhoneModel().SearchByPhoneID(Integer.parseInt(request.getParameter("PhoneID")));
	%>
<fmt:setBundle var="b" basename="myapp" scope="session"/>
	<jsp:include page="frmAHeader.jsp"></jsp:include>
	
	<div>
		<h2>
			<fmt:message key="AEditPhone.Tittle" bundle="${ b }"/>
		</h2>
		<br/>
		<form action="EditPhoneAction" method="post">
		<table>
			<tr>
				<td>
					<fmt:message key="AEditPhone.PhoneID" bundle="${ b }"/>			
				</td>
				<td>
					<b>
						<%=phone.getPhoneID() %>
					</b>
				</td>
			</tr>
			<tr>
				<td>
					<fmt:message key="AEditPhone.PhoneName" bundle="${ b }"/>			
				</td>
				<td>
					<input type="text" name="PhoneName" value="<%=phone.getPhoneName() %>"/>
				</td>
			</tr>
			<tr>
				<td>
					<fmt:message key="AEditPhone.PhoneType" bundle="${ b }"/>			
				</td>
				<td>
					<b><%=phone.getPhoneType() %></b>
				</td>
			</tr>
			<tr>
				<td>
					<fmt:message key="AEditPhone.Description" bundle="${ b }"/>			
				</td>
				<td>
					<input type="text" name="Description" value="<%=phone.getDescription()%>"/>
				</td>
			</tr>
			<tr>
				<td>
					<fmt:message key="AEditPhone.Price" bundle="${ b }"/>			
				</td>
				<td>
					<input type="text" name="Price" value="<%=phone.getPrice() %>"/> VND
				</td>
			</tr>
			<tr>
				<td>
					<fmt:message key="AEditPhone.Picture" bundle="${ b }"/>			
				</td>
				<td>
					<input type="text" name="Picture" value="<%=phone.getPicture()%>"/>
				</td>
			</tr>
		</table>
		<div>
			<input type="submit" value="<fmt:message key="AEditPhone.btEditPhone" bundle="${ b }"/>"/>
		</div>
		</form>
	</div>
	
	<jsp:include page="frmAFooter.jsp"></jsp:include>
</body>
</html>